<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    

    <style>
        form{
            opacity: 1;
            transform: translate(400px,0px);
        }
        .form-active{
            transform: translate(0px,0px);
            transition: all 5s ease-in;
        }
        .form-exit{
            opacity: 0;
            transform: translate(0px,600px);
            transition: all 3s ease-out;
        }
    </style>
</head>
<body onload="handler(event)">
    <form action="" onsubmit="exit(event)">
        <div>
            <label for="">账号:</label>
            <input type="text">
        </div>
        <div>
            <label for="">密码:</label>
            <input type="text">
        </div>
        <div>
            <input type="submit" value="提交">
        </div>
    </form>
    <script>
        console.log(window);
        const form = document.querySelector('form')
        function handler(e){
            form.classList.add('form-active')
        }
        function exit(e){
            e.preventDefault()
            form.classList.remove('form-active')
            form.classList.add('form-exit')
        }
    </script>
</body>
</html>